package com.ipzoe.mem.model;

import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.ipzoe.common.annotation.Excel;
import com.ipzoe.mem.domain.MemberRechargePackage;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import lombok.ToString;
import lombok.experimental.Accessors;

import java.io.Serializable;
import java.util.Date;

/**
 * 会员充值套餐对象 mem_member_recharge_package
 * 
 * @author eric
 * @date 2020-08-20
 */
@Data
@ToString
@EqualsAndHashCode
@NoArgsConstructor
@Accessors(chain = true)
public class MemberRechargePackageSnapshotDTO implements Serializable {

    private static final long serialVersionUID=1L;
    /** $column.columnComment */
    private Long id;

    /** 套餐名称 */
    private String name;

    /** 套餐价格 */
    private Integer price;

    /** 有效单位数量 */
    private Integer effectiveNum;

    /** 有效单位 */
    private Integer effectiveUnit;

    /** 套餐有效期 */
    @JsonFormat(pattern = "yyyy-MM-dd")
    private Date expiryDay;

    public MemberRechargePackageSnapshotDTO(MemberRechargePackage memberRechargePackage){
        this.id = memberRechargePackage.getId();
        this.name = memberRechargePackage.getName();
        this.price = memberRechargePackage.getPrice();
        this.effectiveNum = memberRechargePackage.getEffectiveNum();
        this.effectiveUnit = memberRechargePackage.getEffectiveUnit();
        this.expiryDay = memberRechargePackage.getExpiryDay();
    }
}
